<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0" />
<title>维修记录</title>
<script>
		$(document).ready(function() {
		 $("#maintenanceDate").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d',maxDate:'#F{$dp.$D(\'nextMaintenanceDate\')}',dateFmt:'yyyy-MM-dd'});});
		 $("#nextMaintenanceDate").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'maintenanceDate\')}',dateFmt:'yyyy-MM-dd'});});
		
		 $("#mainForm").validate({
			 rules:{
				  maintenanceDate:{
					 required:true, 
				  },
				  nextMaintenanceDate:{
					  required:true, 
				  }
			 }
		 });
		});
		function batchAdd(action,form){
		    if (confirm('确定执行[添加]操作?')){
		        form.action = action;
		        form.submit();
		    }
		}
	</script>
</head>
<body>
<div id="message"><s:actionmessage theme="custom"
	cssClass="success" /></div>
<form id="mainForm" action="${ctx }/asset/equipment/maintenance.action" method="post" class="yform">
<div id="filter">
<ul>
<li>维修时间:<input id="maintenanceDate" type="text" name="filter_LIKES_maintenanceDate" value="${param['filter_LIKES_maintenanceDate'] }"/></li>
<li>下次维修时间:<input id="nextMaintenanceDate" type="text" name="filter_LIKES_nextMaintenanceDate" value="${param['filter_LIKES_nextMaintenanceDate'] }"/></li>
<li>备注:<input type="text" name="filter_LIKES_remark" value="${param['filter_LIKES_remark'] }"/></li>
</ul>
<div class="type-button"><input type="hidden" name="id" value="${id}" />  
 			<input type="hidden" name="equipId" value="${equipId}" />
<input type="button" onclick="batchAdd('${ctx }/asset/equipment/maintenance!save.action',document.forms.mainForm)" value="添加" />
</div>
</div>
<div id="content">
<table id="contentTable">
	<tr>
		<th><a id="createDate" href="javascript:sort('createDate','asc')">序号</a></th>
		<th><a id="maintenanceDate" href="javascript:sort('maintenanceDate','asc')">维修时间</a></th>
		<th><a id="nextMaintenanceDate" href="javascript:sort('nextMaintenanceDate','asc')">下次维修时间</a></th>
		<th>操作</th>
	</tr>
	<c:forEach items="${maintenanceList}" var="maintenance" varStatus="status">
		<tr>
			<td>${pag.first+1+status.index }</td>
			<td>${maintenance.maintenanceDate}</td>
			<td>${maintenance.nextMaintenanceDate}</td>
			<td><a href="${ctx}/asset/equipment/maintenance!input.action?id=${maintenance.id}&equipId=${maintenance.equipInformation.id}">编辑</a>
			<a href="${ctx}/asset/equipment/maintenance!delete.action?id=${maintenance.id}&equipId=${maintenance.equipInformation.id}" onclick="return confirmDelete();">删除</a>
			</td>
		</tr>
	</c:forEach>
</table>
</div>
</form>
</body>

